﻿@model AuctionDataLayer.Bid

@{
    ViewBag.Title = "Cancel bid";
}
<div class="page">
    <div class="black-shadow-box delete-bid">
        <h3>Are you sure you want to cancel this bid?</h3>

        <legend>Bid information</legend>

        @{ int id = Convert.ToInt32(ViewData["userId"]); }

        @if (Model.Group.Id == id)
        {
            <div class="display-label">Personal bid</div>        
        }
        else
        { 
            <div class="display-label">Group Name</div>
            <div class="display-field">
                @Html.DisplayFor(model => model.Group.Name)
            </div>    
        }

        <div class="display-label">Date</div>
        <div class="display-field">
            @Model.Date.ToLongDateString()
        </div>

        <div class="display-label">Start Time</div>
        <div class="display-field">
            @Model.StartTime.ToShortTimeString()
        </div>

        <div class="display-label">End Time</div>
        <div class="display-field">
            @Model.EndTime.ToShortTimeString()
        </div>

        <div class="display-label">Room</div>
        <div class="display-field">        
            @if (Model.AnyRoom == true)
            {
                <span class="item-name">Any</span>
            }
            else 
            { 
                <span class="item-name">@Html.DisplayFor(model => model.Room.Name)</span> 
            }
        </div>

        <div class="display-label">Bidding Amount</div>
        <div class="display-field">
            @Html.DisplayFor(model => model.BiddingAmount)
        </div>
    
        @using (Html.BeginForm())
        {
            <p>
                <input type="submit" class="input-button" value="Delete" /> <input type="button" value="Cancel" class="input-button" onclick="javascript:document.location.href='@Url.Action("Index", "Bids")'"/>                
            </p>
        }
    </div>
</div>